<link rel="stylesheet" href="/css/paging.css" type="text/css"/>
#define paginate(currentPage, totalPage, actionUrl, urlParams)
#if( (totalPage <= 0) || (currentPage > totalPage))

#else

#set(startPage = currentPage - 5)
#if(startPage < 1)
#set(startPage = 1)
#end

#set(endPage = startPage + 9)

#if(endPage > totalPage)
#set(endPage = totalPage)
#end

#if(endPage - 9 > 0)
#set(startPage = endPage - 9)
#else
#set(startPage = 1)
#end

#if(totalPage > 1)
<div class="page">
    #if(currentPage == 1)
    <span class="disabled first_page">首页</span>
    <span class="disabled prev_page">上页</span>
    #else
    <a href="#(actionUrl)?number=#(i)&#(urlParas)" class="first_page">首页</a>
    <a href="#(actionUrl)?number=#(currentPage - 1)&#(urlParas)" class="prev_page">上页</a>
    #end

    #for(i = 1; i<= endPage; i++)
    #if(currentPage == i)
    <span class="current">#(i)</span>
    #else
    <a href="#(actionUrl)?number=#(i)&#(urlParas)">#(i)</a>
    #end
    #end

    #if(currentPage == totalPage)
    <span class="disabled next_page">下页</span>
    <span class="disabled last_page">尾页</span>
    #else
    <a href="#(actionUrl)?number=#(currentPage + 1)&#(urlParas)" class="next_page" rel="next">下页</a>
    <a href="#(actionUrl)?number=#(totalPage)&#(urlParas)" class="last_page" rel="last">尾页</a>
    #end
</div>
#end
#end
#end